package Ex1;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class App {

	public static void main(String[] args) {

		Map<String, Customer> customers = new HashMap<String, Customer>();
		
		Customer c1 = new Customer("1234567", "2345678", "John", "Doe");
		Customer c2 = new Customer("3245333", "8549444", "Jane", "Doe");
		Customer c3 = new Customer("8533555", "4823455", "Billy", "Bob");
		Customer c4 = new Customer("3443355", "9432533", "Jilly", "Dibby");
		
		customers.put(c1.getPhoneNo(), c1);
		customers.put(c2.getPhoneNo(), c2);
		customers.put(c3.getPhoneNo(), c3);
		customers.put(c4.getPhoneNo(), c4);
	
		System.out.println("Classes:");
		System.out.println(c1);
		System.out.println(c2);
		System.out.println(c3);
		System.out.println(c4);
		System.out.println();
		
		System.out.println("HasMap key set:");
		System.out.println(customers.keySet());
		System.out.println("HasMap entry set:");
		System.out.println(customers.entrySet());
		System.out.println("HasMap values:");
		System.out.println(customers.values());
		System.out.println("HasMap in whole:");
		System.out.println(customers);
		System.out.println();

		customers = new TreeMap<String, Customer>(customers);
		
		System.out.println("TreeMap key set:");
		System.out.println(customers.keySet());
		System.out.println("TreeMap entry set:");
		System.out.println(customers.entrySet());
		System.out.println("TreeMap values:");
		System.out.println(customers.values());
		System.out.println("TreeMap in whole:");
		System.out.println(customers);
		System.out.println();

	}

}
